#include "derivative.h" /* include peripheral declarations */

#ifndef BOARD_SUPPORT_H
#define BOARD_SUPPORT_H


#define KILL_THE_DOG SOPT1 &=~SOPT1_COPE_MASK

#define LED1_LOC   0x04
#define LED2_LOC   0x08          
#define LED3_LOC   0x10
#define LED4_LOC   0x20

#define SW1_LOC    0x40
#define SW2_LOC    0x80
#define SW3_LOC    0x10
#define SW4_LOC    0x80


#define LED1_ON   PTCD&=~LED1_LOC
#define LED2_ON   PTCD&=~LED2_LOC
#define LED3_ON   PTCD&=~LED3_LOC
#define LED4_ON   PTCD&=~LED4_LOC

#define LED1_OFF   PTCD|=LED1_LOC
#define LED2_OFF   PTCD|=LED2_LOC
#define LED3_OFF   PTCD|=LED3_LOC
#define LED4_OFF   PTCD|=LED4_LOC

#define LED1_TOGGLE   PTCD^=LED1_LOC
#define LED2_TOGGLE   PTCD^=LED2_LOC
#define LED3_TOGGLE   PTCD^=LED3_LOC
#define LED4_TOGGLE   PTCD^=LED4_LOC


#define SW1_ACTIVE (~PTAD&SW1_LOC)
#define SW2_ACTIVE (~PTAD&SW2_LOC)
#define SW3_ACTIVE (~PTAD&SW3_LOC)
#define SW4_ACTIVE (~PTCD&SW4_LOC)


extern void InitGPIO(void);

#endif                     